home *** CD-ROM | disk | FTP | other *** search
/ Champak 43 / Vol 43.iso / games / phit.swf / scripts / __Packages / CCircle.as < prev    next >
Encoding:
Text File  |  2007-07-13  |  764 b   |  37 lines

  1. class CCircle extends CCollisionVolume
  2. {
  3.    var m_body;
  4.    var m_radius = 1;
  5.    var m_radiusSquared = 1;
  6.    function CCircle(body, radius)
  7.    {
  8.       super(body);
  9.       this._radius = radius;
  10.    }
  11.    function get _center()
  12.    {
  13.       return this.m_body._location;
  14.    }
  15.    function get _boundingRadius()
  16.    {
  17.       return this.m_radius;
  18.    }
  19.    function get _radius()
  20.    {
  21.       return this.m_radius;
  22.    }
  23.    function set _radius(r)
  24.    {
  25.       this.m_radius = r;
  26.       this.m_radiusSquared = r * r;
  27.    }
  28.    function get _topLeftCorner()
  29.    {
  30.       return this.m_body._location.GetSubtractScalar(this.m_radius);
  31.    }
  32.    function get _bottomRightCorner()
  33.    {
  34.       return this.m_body._location.GetAddScalar(this.m_radius);
  35.    }
  36. }
  37.